package quizSuggestion

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'GET'
        url value(consumer(regex('/api/v2/assignments/\\d+/quizzes/\\d+/suggestions')),
                producer('/api/v2/assignments/1/quizzes/1/suggestions'))
        headers {
            contentType(applicationJsonUtf8())
            header('id', 21)
        }
    }
    response {
        status 200
        headers {
            contentType(applicationJsonUtf8())
        }
        bodyMatchers {
            jsonPath('$.[*].studentId', byRegex(number()))
            jsonPath('$.[*].assignmentId', byRegex(number()))
            jsonPath('$.[*].quizId', byRegex(number()))

        }
    }
}